﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="homepage.aspx.cs" Inherits="Ccit.SysPlat.Frame.homepage" %>
<%@ Register assembly="Microsoft.Web.UI.WebControls, Version=1.0.2.226, Culture=neutral, PublicKeyToken=31bf3856ad364e35" namespace="Microsoft.Web.UI.WebControls" tagprefix="iewc" %>
<html style="height:100%">
<head runat="server">
    <title>武商OA信息管理平台</title>      
    <link href="css/enter.css" rel="stylesheet" type="text/css">    
    <link href="css/main.css" rel="stylesheet" type="text/css" />
    <script language="javascript" src="script/jquery.js" type="text/javascript"></script>
    <script language="javascript" src="script/jwindow.js" type="text/javascript"></script>
    <script language="javascript" src="script/jbase64.js" type="text/javascript"></script>
    <style type="text/css">    
    #nav, #nav ul {
      float:left; /* 菜单总体水平位置 */
      list-style:none;
      line-height:22px; /* 一级菜单高 */
      background: #eee; /* 所有菜单移出色 */
      font-weight: bold;
      padding:0px;
      margin:0px;
      border:1px solid #ccc;
      border-right: 0px;
    }
    #nav ul ul{
      border:1px solid #ccc;
      border-top:0px;
      border-right:0px;
    }
    #nav a {
      width:120px;
      display:block;
      color:#333;
      text-decoration:none;
      text-align:center;
      border-right:1px solid #CCC;
    }
    #nav a:hover{color:#000;} /* 所有 a:hover 字体样式 */
    #nav a.selected{background:url(images/arrow_01.gif) no-repeat right 50%;} /* 下拉图标 */
    #nav li {float:left;}
    #nav li ul { /* 二级弹出位 */
      position:absolute;
      margin:0px 0px 0px -1px;
      padding:0;
      left:-9999em;
      width:120px;
      font-weight:normal;
    }
    #nav li li {width:120px;} /* 二级菜单宽 */
    #nav li ul a {
      width:120px; /* 二级菜单宽 */
      padding:0px 12px; 
      line-height:20px; /* 二级菜单高 */
      border-top:1px solid #CCC;
      text-align:left;
    }
    #nav li ul ul {margin:-25px 0px 0px 119px;} /* 三级弹出位 */
    #nav li:hover ul ul,#nav li.sfhover ul ul{left:-9999em;}
    #nav li:hover ul,#nav li li:hover ul,#nav li.sfhover ul, #nav li li.sfhover ul{left:auto;} /* 所有弹出菜单自动左边距 */
    #nav li:hover, #nav li.sfhover {background:#ccc;} /* 所有悬浮样式 */
    .divscroll {
    		overflow:auto;
    		height:100%;
    		width:100%;
    		scrollbar-face-color: #f1f1fe1;
    		scrollbar-shadow-color: #ffffff;
    		scrollbar-highlight-color:#ffffff;
    		scrollbar-3dlight-color: #ffffff;
    		scrollbar-darkshadow-color: #ffffff;
    		scrollbar-track-color:#ffffff;
    		scrollbar-arrow-color: ffffff;
    }
    .skin { BORDER-RIGHT: buttonhighlight 2px outset; BORDER-TOP: buttonhighlight 2px outset; FONT-SIZE: 9pt; VISIBILITY: hidden; BORDER-LEFT: buttonhighlight 2px outset; WIDTH: 100px; CURSOR: default; BORDER-BOTTOM: buttonhighlight 2px outset; FONT-FAMILY: Arial, Helvetica, sans-serif; POSITION: absolute; BACKGROUND-COLOR: menu; TEXT-ALIGN: left }
	.menuitems { PADDING-RIGHT: 4px; PADDING-LEFT: 2px; PADDING-TOP: 2px; PADDING-BOTTOM: 12px;}
    </style>
    <script type="text/javascript">
    <!--
        function doGotoHomePage() {
            var strURL = "./homepage.aspx";
            document.location.href = strURL;
        }
        
        function doGotoPrePage() {
            history.go(-1);
        }
        
        function doGotoNextPage() {
            history.go(1);
        }
        
        function doRefresh() {
            self.frames[0].location.reload();
        }
        
        function doReLogin() {
            if (confirm("是否要重新登陆?")) {
                return true;
//                document.location.href = "./index.aspx";    
            }
            
            return false;
        }
        
        function doModifyPwd() {
            var vUserId = $get("_hidUserId").value;
            var vPageParam = "userid=" + vUserId;
            var encodeParam = base64encode(vPageParam);
            var strURL = "SysOrgan/sys_userpwd_edit.aspx?" + encodeParam;
            OpenWindow(strURL,"",400,215);
        }
        
        function doSetFrame() {
            var vPageParam = "sys=2";
            var encodeParam = base64encode(vPageParam);
        	var strURL = "SysPlate/sys_plate_layout.aspx?" + encodeParam;
            OpenWindow(strURL,"",800,640);
        }
        
        function doExit() {
            window.close();
        }
        function MM_preloadImages() { //v3.0
          var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
          var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
          if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
        }
        
        function MM_swapImgRestore() { //v3.0
          var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
        }

        function MM_findObj(n, d) { //v4.01
          var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
            d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
          if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
          for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
          if(!x && d.getElementById) x=d.getElementById(n); return x;
        }

        function MM_swapImage() { //v3.0
          alert("");
          var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
           if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
        }
        
        function doExpandCollapse(pExpandId) {
            
            var vExpandSign = $get(pExpandId).value;
            // 标志为0 表示当前是展开状态；为1 表示当前为折叠状态
            var oImgExpand = $get("imgExpand");
            var oTdMenuPanel = $get("tdMenuPanel");
            if(vExpandSign == "0") {
                oImgExpand.alt = "展开";
                oImgExpand.src = "images/showmenu.gif";
                oTdMenuPanel.style.display = "none";
                $get(pExpandId).value = "1";
            }
            else {
                oImgExpand.alt = "折叠";
                oImgExpand.src = "images/hidemenu.gif";
                oTdMenuPanel.style.display = "block";
                $get(pExpandId).value = "0";
            }
            
            
        }
        
        function doSetShortCut() {
        
        }
        
        // 菜单切换
        function doCutOverMenu(pMenuId,pMenuType) {
            /* div中存放控件顺序
             *  0: hidden 存放模块Id
             *  1: spanempty
             *  2: img
             *  3: anchor
             *     3.1: span: 链接文本(模块标题) */
             
             var ctrlDivFixed = $get("divFirstMenu");
             var vOperDivId = "";
             if(pMenuType == "DIV") {
                vOperDivId = "div_" + pMenuId;
             }
             else if(pMenuType == "TD"){
                vOperDivId = "td_" + pMenuId;
             }
             else if(pMenuType == "FLOAT") {
                vOperDivId = "float_" + pMenuId;
             }
             var ctrlOperDiv = $get(vOperDivId);
             
             /* 取出fixed div 信息 */
//             var vFixedMenuId = ctrlDivFixed.children(0).value;
//             var vFixedImg = ctrlDivFixed.children(2).src;             
//             var vFixedMenuName = ctrlDivFixed.children(3).children(0).innerHTML;
             
             /* 取出当前操作菜单的信息 */
             var vOperImg;
             var vOperMenuName;
             
             if(pMenuType == "DIV") {
                vOperImg = ctrlOperDiv.children(1).src;            
                vOperMenuName = ctrlOperDiv.children(2).children(0).innerHTML;
             }
             else if(pMenuType == "TD"){
                vOperImg = ctrlOperDiv.children(1).children(0).src;            
                vOperMenuName = ctrlOperDiv.children(0).value;
             }
             else if(pMenuType == "FLOAT") {
                vOperImg = ctrlOperDiv.children(0).src;
                vOperMenuName = "&nbsp;" + ctrlOperDiv.innerText;
             }
           
             
             /* 交换Div信息 */
             ctrlDivFixed.children(0).value = pMenuId;
             ctrlDivFixed.children(2).src = vOperImg;
             ctrlDivFixed.children(3).children(0).innerHTML = vOperMenuName;
             
//             ctrlOperDiv.id = "div_" + vFixedMenuId;
//             ctrlOperDiv.children(1).src = vFixedImg;
//             ctrlOperDiv.children(2).href = "javascript:doCutOverMenu('" + vFixedMenuId + "')";
//             ctrlOperDiv.children(2).children(0).innerHTML = vFixedMenuName;
             
             var vUserId = $get("_hidUserId").value;
             var vUserType = $get("_hidUserType").value;
             var vOrganId = $get("_hidOrganId").value;
             PageMethods.GetMenuXML(pMenuId,vUserId,vUserType,vOrganId,ClientCallBack);
        }

        function ClientCallBack(vResult) {
            if (null == vResult || vResult == "undefined") {
                alert("网络传输错误,没有正确的返回值,请检查网络是否畅通!");
                return;
            }
            eval("var resultObj=" + vResult);
            var operType = resultObj.OPERTYPE;
            switch (operType) {
                case "GETMENUXML":
                    createMenuTree(resultObj.MENUS);
                    break;
                case "LOGOUTUSER":                    
                    break;
            }
            resultObj = null;
        }

        function createMenuTree(serMenuArray) {
            eval("var menuArray=" + serMenuArray);
            var itemCount = menuArray.length;
            if(itemCount == 0) return;
            
            //获取一级菜单
            oneMenu = findMenus(menuArray,"1",itemCount);
            var ctrlTree = $get("trvMenu");
            clearTreeNodes(ctrlTree,oneMenu[0]);
            
            var ctrlRoot = ctrlTree.createTreeNode();
            var vShowText = oneMenu[0].menuName;
		    var vImgURL = oneMenu[0].imgPath;
		    ctrlRoot.setAttribute("Text",vShowText);		         
		    ctrlRoot.setAttribute("ImageUrl",vImgURL);
		    
		    
		    //return ctrlRoot;	
            var vExpandLevel = addLayTwoNodes(ctrlTree,ctrlRoot,menuArray,itemCount);
            ctrlRoot.setAttribute("EXPANDED",true);
            ctrlTree.add(ctrlRoot);   
        }
        
        function findMenus(menuArray,lay,itemCount) {
            var findMenuArray = [];
            var msMenu;
            for(var i = 0; i < itemCount; i ++) {
                msMenu = menuArray[i];
                if(msMenu.lay == lay) findMenuArray.push(msMenu);
                if(lay == "1") break;
            }
            if (lay == "2") bubbleSort(findMenuArray);
            return findMenuArray;
        }

        function bubbleSort(arr) {            
            for (var i = 0; i < arr.length; i++) {                
                for (var j = i; j < arr.length; j++) {
                    if (parseInt(arr[i].orderNo) > parseInt(arr[j].orderNo)) {                        
                        var temp = arr[i];
                        arr[i] = arr[j];
                        arr[j] = temp;
                    }
                }
            }
        }
        
        function clearTreeNodes(ctrlTree,oneMenu) {           
		    var ctrlRoot = ctrlTree.getTreeNode("0"); 
		    ctrlRoot.remove();
		    
//		    var vShowText = oneMenu.menuName;
//		    var vImgURL = oneMenu.imgPath;
//		    ctrlRoot.setAttribute("Text",vShowText);		         
//		    ctrlRoot.setAttribute("ImageUrl",vImgURL);
//		    
//		    return ctrlRoot;		        
        }
        
        function addLayTwoNodes(ctrlTree,ctrlRoot,menuArray,itemCount) {
            var twoMenus = findMenus(menuArray,"2",itemCount);
            var twoCount = twoMenus.length;
            if(twoCount == 0) return;
            
            var twoMenu;
            var oTreeNode;            
            var vLeaf = "";
            var vMenuName = "";
            var vImgUrl = "";
            var vPageUrl = "";            
            var vTwoLevel = "0";
            var vThreeLevel = "0";
            var vLevel = "0";
            
            for(var i = 0; i < twoCount; i ++) {
                twoMenu = twoMenus[i];
                vLeaf = twoMenu.isLeaf;
                vMenuName = twoMenu.menuName;
                vImgUrl = twoMenu.imgPath;
                if(vLeaf == "0") {  //非叶子节点
                    oTreeNode = createTreeNode(ctrlTree,vMenuName,"",vImgUrl,vLeaf);
                    vLevel = addLayThreeNodes(ctrlTree,oTreeNode,menuArray,itemCount,twoMenu.layCode);
                }
                else {
                    vPageUrl = twoMenu.pagePath;
                    oTreeNode = createTreeNode(ctrlTree,vMenuName,vPageUrl,vImgUrl,vLeaf);
                }
                
                if(vTwoLevel == "0") vTwoLevel = "1";
                if(vLevel != "0" && vThreeLevel == "0") vThreeLevel = vLevel;                    
                ctrlRoot.add(oTreeNode);                
            }
            
            if(vThreeLevel != "0") return vThreeLevel;
            else return vTwoLevel;
        }
        
        function addLayThreeNodes(ctrlTree,ctrlTwoNode,menuArray,itemCount,layTwoCode) {
            var threeMenus = findThreeMenus(menuArray, "3", itemCount, layTwoCode);
            var threeCount = threeMenus.length;
            if(threeCount == 0) return;
            
            var threeMenu;        
            var oTreeNode;            
            var vLeaf = "";
            var vMenuName = "";
            var vImgUrl = "";
            var vPageUrl = "";           
            var vLevel = "0";
            
            for(var i = 0; i < threeCount; i ++) {
                threeMenu = threeMenus[i]
                vMenuName = threeMenu.menuName;
                vImgUrl = threeMenu.imgPath;
                vPageUrl = threeMenu.pagePath;
                oTreeNode = createTreeNode(ctrlTree,vMenuName,vPageUrl,vImgUrl,"1");
                ctrlTwoNode.add(oTreeNode);
                if(vLevel == "0") vLevel = "2";
            }
            
            return vLevel;
        }


        function findThreeMenus(menuArray, lay, itemCount,layTwoCode) {
            var findMenuArray = [];
            var msMenu;
            for (var i = 0; i < itemCount; i++) {
                msMenu = menuArray[i];
                if (msMenu.lay == lay && msMenu.layCode.substring(0,12) == layTwoCode) findMenuArray.push(msMenu);
            }
            bubbleSort(findMenuArray);
            return findMenuArray;
        }
        
        function createTreeNode(ctrlTree,pMenuName,pPageUrl,pImgUrl,pLeaf) {
            var oTreeNode = ctrlTree.createTreeNode();
            
            oTreeNode.setAttribute("Text",pMenuName);                        
            oTreeNode.setAttribute("ImageUrl",pImgUrl);
            if(pLeaf == "1") {
                oTreeNode.setAttribute("Target","ifrmContent");                
            }
            else {
                oTreeNode.setAttribute("Target","");                
            }
            oTreeNode.setAttribute("NavigateUrl",pPageUrl);
            
            return oTreeNode;
        }
        
        var menuskin = "skin";		
		var menuname = "root";
        
        function doExpandMenus(e) {
            hideMenu();
			
			var obj = document.getElementById("root");				
			if (null == obj || typeof(obj) == "undefined")
			{
				node = null;
				return false;
			}
			
//			var expandSign = document.getElementById("_hidExpModeSign").value;
//			expandSign = (expandSign == "") ? "0" : expandSign;
//			if(expandSign == "0") {
			   var intX=0,intY=0;    
                if(e==null)
                {        
                    e=window.event;        
                }
                
                if(e.pageX || e.pageY)
                {
                    intX=e.pageX; intY=e.pageY;
                }
                else if(e.clientX || e.clientY)
                {
                    if(document.documentElement.scrollTop)
                    {
                        intX=e.clientX+document.documentElement.scrollLeft;
                        intY=e.clientY+document.documentElement.scrollTop;
                    }
                    else
                    {
                        intX=e.clientX+document.body.scrollLeft;
                        intY=e.clientY+document.body.scrollTop;
                    }
                }
                
                var floatMenuCount = document.getElementById("root").childNodes.length;
                floatMenuCount = (floatMenuCount == "" || floatMenuCount == "undefined") ? 0 : floatMenuCount;
                var excursion = floatMenuCount * 30;
                
                obj.style.top = (intY-excursion)+"px";
                obj.style.left = (intX - 2)+"px";
        		
		        obj.style.visibility = "visible";
		        document.getElementById("_hidExpModeSign").value = "1";
//			}
//			else {
//			    obj.style.visibility = "hidden";
//			    document.getElementById("_hidExpModeSign").value = "0";
//			}
        }
        
        function hideMenu() 
		{		    
			var obj = document.getElementById(menuname);
			if (null != obj && typeof(obj) != "undefined")
				document.getElementById(menuname).style.visibility = "hidden";
		}
		
		function highlighItem() 
		{
			if (event.srcElement.className == "menuitems") 
			{
				event.srcElement.style.backgroundColor = "highlight";
				event.srcElement.style.color = "white";
			}
		}
		function lowlightItem() 
		{
			if (event.srcElement.className == "menuitems") 
			{
				event.srcElement.style.backgroundColor = "";
				event.srcElement.style.color = "black";
				window.status = "";
			}
		}
		
		function clickItem(menuId) {
		    doCutOverMenu(menuId,"FLOAT");
		    hideMenu();
		}

		function doRelease() {
		    var unLoadSign = $get("_hidUnLoadSign").value;
		    if (unLoadSign == "0") {
		        PageMethods.DoLogOutUser(ClientCallBack);
		    }
		}

		function doExpandSubMenu() {
		    var nodeIndex = document.getElementById("trvMenu").clickedNodeIndex;
		    var node = document.getElementById("trvMenu").getTreeNode(nodeIndex);

		    if (node == null) return;

		    trvMenu.selectedNodeIndex = nodeIndex;
		    var nodeTarget = node.getAttribute("Target");
		    var expandSign = node.getAttribute("EXPANDED");
		    if (null == nodeTarget || nodeTarget == "") {
		        if (expandSign == true)
		            node.setAttribute("EXPANDED", false);
		        else
		            node.setAttribute("EXPANDED", true);
		    }
		}

		function doPersonSet() {
		    var strURL = "Psnset/psnset_opinion_frame.aspx";
		    OpenWindow(strURL, "", 600, 320);
		}

		function doWriteMsg() {
		    var vPageParam = "PageSource=6";
		    var encodeParam = base64encode(vPageParam);
		    var strURL = "msg/msg_send_edit.aspx?" + encodeParam;
		    OpenWindow(strURL, "", 750, 550);
		}
    //-->
    </script>
</head>
<body onclick="hideMenu()" onunload="doRelease()">
    <form id="form1" runat="server">
    <input type="hidden" id="_hidUserId" runat="server" />
    <input type="hidden" id="_hidUserType" runat="server" />
    <input type="hidden" id="_hidOrganId" runat="server" />
    <input type="hidden" id="_hidMenuCutSign" />    
    <input type="hidden" id="_hidMenuSelMode" runat="server" />
    <input type="hidden" id="_hidSession" runat="server" />
    <input type="hidden" id="_hidExpModeSign" runat="server" />
    <input type="hidden" id="_hidUnLoadSign" runat="server" />
    <input type="hidden" id="_hidFrameSet" runat="server" /><!--框架设置更新布局设置标志0:否 1:框架设置更新布局-->
    <asp:ScriptManager ID="ScriptManager1" EnablePageMethods="true" runat="server"></asp:ScriptManager>
        <table width="100%"  border="0" cellspacing="0" cellpadding="0">
          <tr> <!-- title bar row -->
            <td width="27%" background="images/titlebg.jpg"><img src="images/logo.jpg" width="209" height="45"></td>
            <td width="30%" background="images/titlebg.jpg">
                <asp:Label ID="lbLgUser" runat="server"></asp:Label>
            </td>
            <td width="43%" background="images/titlebg.jpg">
                <table width="383"  border="0" align="right" cellpadding="0" cellspacing="0" background="images/lmbg.jpg">
                    <tr>
                      <td width="33"><img src="images/lmleft.jpg" width="33" height="45"></td>
                      <td valign="top">
                        <table width="360"  border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td width="10%"><div align="center"><img src="images/icon/home.gif" width="14" height="14"></div></td>
                            <td width="10%"><div align="center"><img src="images/icon/back.gif" width="15" height="13"></div></td>
                            <td width="10%"><div align="center"><img src="images/icon/forward.gif" width="15" height="13"></div></td>
                            <td width="11%"><div align="center"><img src="images/icon/refresh.gif" width="13" height="16"></div></td>
                            <%--
                            <td width="14%"><div align="center"><img src="images/icon/icon_04.gif" width="13" height="16"></div></td>
                            <td width="14%"><div align="center"><img src="images/icon/frameset.gif" width="16" height="14"></div></td>
                            --%>
                            <td width="14%"><div align="center"><img src="images/icon/collect.gif" width="16" height="13"></div></td>                             
                            <td width="12%"><div align="center"><img src="images/icon/quit.gif" width="16" height="16"></div></td>
                          </tr>
                          <tr valign="top">
                            <td><div align="center"><a href="javascript:doGotoHomePage()">首页</a></div></td>
                            <td><div align="center"><a href="javascript:doGotoPrePage()">后退</a></div></td>
                            <td><div align="center"><a href="javascript:doGotoNextPage()">前进</a></div></td>
                            <td><div align="center"><a href="javascript:doRefresh()">刷新</a></div></td>   
                            <%--
                            <td><div align="center"><a href="javascript:doModifyPwd()">修改密码</a></div></td>                     
                            <td><div align="center"><a href="javascript:doSetFrame()">框架设置</a></div></td>  
                            --%>
                            <td><div align="center"><asp:LinkButton ID="lnbReLogin" runat="server" 
                                    onclick="lnbReLogin_Click">重新登陆</asp:LinkButton></div></td>                                                            
                            <td><div align="center"><a href="javascript:doExit()">退出</a></div></td>
                          </tr>
                        </table>
                      </td>
                    </tr>
               </table>
             </td>
          </tr>
          <tr bgcolor="#F5F5F5"> <!-- shortcut row -->
            <td colspan="3">
              <table width="50" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td height="20">
                     <table width="45" border="0" align="center" cellpadding="0" cellspacing="0">
                        <tr>
                            <td>
                              <div align="left">
                                <input type="hidden" id="_hidExpand" value="0" />
                                <a href="javascript:doExpandCollapse('_hidExpand')" >
                                    <img src="images/hidemenu.gif" alt="折叠" name="imgExpand" width="13" height="13" border="0" id="imgExpand">
                                </a>
                              </div>
                            </td>
                            <td>
                              <div align="center">                                
                              </div>
                            </td>
                        </tr>
                    </table>
                  </td>
                </tr>
             </table>
           </td>
         </tr>
         <tr bgcolor="#FF0000"><td colspan="3" height="2"></td></tr> <!-- separator row -->
        </table>
        <table width="100%" height="84%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td id="tdMenuPanel" width="189" height="100%" valign="top"> <!-- Menu Tree cell -->
              <table width="189" height="100%"  border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td width="2" bgcolor="#FADFE0"><img src="images/str.gif" width="2" height="1"></td>
                  <td width="189" valign="top">
                     <table id="tblMenus" runat="server" width="100%" height="100%"  border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td height="25" valign="middle" background="images/left_titlebg02.gif">
                          <div id="divFirstMenu" runat="server" align="left"></div> <!-- first Menu fixed -->
                        </td>
                      </tr>
                      <tr>
                        <td height="90%" valign="top">
                            <div class="divscroll">
                                <iewc:TreeView ID="trvMenu" onclick="doExpandSubMenu()" runat="server"></iewc:TreeView>
                            </div>
                        </td>
                      </tr>
                     </table>
                     <table width="100%" height="25px" border="0" cellspacing="0" cellpadding="0"> 
                      <tr>
                        <td height="25px" background="images/left_titlebg.gif">
                          <table width="80%" height="100%" border="0" align="right" cellpadding="0" cellspacing="0">
                            <tr id="trImgMod" runat="server"> 
                                <td>&nbsp;</td>                             
                            </tr>
                          </table>
                        </td>
                      </tr>
                     </table>
                  </td>
                  <td width="2" bgcolor="#FADFE0"><img src="images/str.gif" width="2" height="1"></td>
                </tr>
              </table>
            </td>
            <td valign="top" height="84%"> <!-- show area -->
                <iframe id="ifrmContent" name="ifrmContent" scrolling="yes" width="100%" height="99%" 
                    style="border-right:#CDCECF 1px solid;" onmouseover="hideMenu()" src="" frameborder="0"></iframe>
            </td>
          </tr>
        </table>
        <table width="100%"  border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td bgcolor="#EEEAEB"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="70%">
                    <div align="right"> Copyright (c) 2000 Digital China. All rights reserved. (version : v 3.5) </div>                                        
                </td>  
                <td width="30%" align="right">
                		<a href="javascript:doModifyPwd()" class="mof1">
                        <img src="images/toolbar/grtxl.gif" border='0' alt="修改密码" /></a>
                    &nbsp;
                		<a href="javascript:doSetFrame()" class="mof1">
                        <img src="images/icon/frameset.GIF" border='0' alt="布局设置" /></a>
                    &nbsp;
                    <a href="javascript:doWriteMsg()" class="mof1">
                        <img src="images/toolbar/tzgl.gif" border='0' alt="撰写消息" /></a>
                    &nbsp;
                    <a href="javascript:doPersonSet()" class="mof1">
                        <img src="images/toolbar/SPLOGO.GIF" border='0' alt="个性设置" />
                    </a>
                    &nbsp;
                </td>               
              </tr>
            </table></td>
          </tr>
        </table>
        <div id="root" runat="server" class="skin" style="LEFT:0px; VISIBILITY:hidden; WIDTH:120px; TOP:0px; HEIGHT:32px;
             position: absolute;"></div>
        <!-- #include file="msg/SysRemind.html" -->  
    </form>
    
    <script type="text/javascript">
    <!--
        $(document).ready(function(){     
            var userType = $get("_hidUserType").value;
            // set user info
            eval("var loginUser=" + $get("_hidSession").value);
            var ctrlTitle = $get("lbLgUser");
            if(userType == "0") {
                ctrlTitle.innerText = "欢迎 " + loginUser.userName + " [" + loginUser.deptName + " " + loginUser.posName + "]";
            }
            else {
                ctrlTitle.innerText = "欢迎 " + loginUser.userName;
            }
            loginUser = null;
            
            var menuSelMode = $get("_hidMenuSelMode").value;
            var firstOperNode;
            var nodeIndex;
            var pageURL;
            
            if(userType == "0") {
                if(parseInt(menuSelMode) > 0) {
                    pageURL = "./remindarea.aspx";                    
                }
                else {
                    firstOperNode  = findTreeNode();
                    if(null != firstOperNode && firstOperNode != "undefined") {
                        nodeIndex = firstOperNode.getNodeIndex();
                        $get("trvMenu").selectedNodeIndex = nodeIndex;
                        pageURL = firstOperNode.getAttribute("NavigateUrl");     
                    }
                    else {
                        pageURL = "./remindarea.aspx";  
                    }
                }
            }
            else {
                firstOperNode = findTreeNode();
                if(null != firstOperNode && firstOperNode != "undefined") {
                    nodeIndex = firstOperNode.getNodeIndex();
                    $get("trvMenu").selectedNodeIndex = nodeIndex;
                    pageURL = firstOperNode.getAttribute("NavigateUrl");     
                }
                else {
                    pageURL = "./remindarea.aspx";  
                }                                          
            }
            
            $get("ifrmContent").src = pageURL;
        });
        
        function findTreeNode() {
            var ctrlTree = document.getElementById("trvMenu");		    
		    
		    var ctrlRoot = ctrlTree.getTreeNode("0"); 
		    var ctrlChildNodes = ctrlRoot.getChildren();
	    
		    var ctrlFindNode = recursionFind(ctrlChildNodes);		    
            return ctrlFindNode;

        }
        
        function recursionFind(ctrlChildNodes) {
            var iLen = ctrlChildNodes.length;
            if (iLen == 0) return null;
            var ctrlTreeNode;		    
		    var ctrlSubChildNodes;
		    var bFind = false;
		    
            for(var i = 0; i < 1; i ++) {
		        ctrlTreeNode = ctrlChildNodes[i];		        
		        ctrlSubChildNodes = ctrlTreeNode.getChildren();
		        if(ctrlSubChildNodes.length == 0) {		           
		            bFind = true;
		            break;       
		        }
		        else {		            
		            ctrlTreeNode = recursionFind(ctrlSubChildNodes);
		            if(null != ctrlTreeNode) {
		                bFind = true;
		                break;
		            }		                
		        }
		    }
            
            if(bFind)
                return ctrlTreeNode;
            else
                return null;
        }
        
    //-->
    </script>
</body>
</html>
